<!-- 充值记录 -->
<template>
    <div class=''>
        <el-form :inline="true" :model="row" class="dialog-form" :label-position="'right'" label-width="120px">
            <el-form-item label="账户名称">
                <el-input v-model="row.cloudAcc" placeholder=""></el-input>
            </el-form-item>
            <el-form-item label="公司名称">
                <el-input v-model="row.company_name" placeholder=""></el-input>
            </el-form-item>
            <el-form-item label="法人姓名">
                <el-input v-model="row.username" placeholder=""></el-input>
            </el-form-item>
            <el-form-item label="社会信用代码">
                <el-input v-model="row.shxydm" placeholder=""></el-input>
            </el-form-item>
            <el-form-item label="账户余额(元)">
                <el-input v-model="row.money" placeholder=""></el-input>
            </el-form-item>
            <!-- <el-form-item label="总充值金额(元)">
                <el-input v-model="row.total" placeholder=""></el-input>
            </el-form-item>
            <el-form-item label="总支出(元)">
                <el-input v-model="row.total2" placeholder=""></el-input>
            </el-form-item>
            <el-form-item label="总收入(元)">
                <el-input v-model="row.total3" placeholder=""></el-input>
            </el-form-item>
            <el-form-item label="当日支出(元)">
                <el-input v-model="row.total4" placeholder=""></el-input>
            </el-form-item>
            <el-form-item label="当日收入(元)">
                <el-input v-model="row.total5" placeholder=""></el-input>
            </el-form-item>
            <el-form-item label="当日收入(元)" style="visibility: hidden;">
                <el-input v-model="row.total5" placeholder=""></el-input>
            </el-form-item> -->
            <el-form-item label="当日收入(元)" style="visibility: hidden;">
                <el-input v-model="row.total5" placeholder=""></el-input>
            </el-form-item>
        </el-form>

        <el-table :data="list" style="width: 100%" height="530">
            <!-- <el-table-column prop="user_id" label="用户ID" align="center">
            </el-table-column> -->
            <el-table-column prop="user_id" label="用户ID" align="center" :show-overflow-tooltip="true">
            </el-table-column>
            <el-table-column prop="company_name" label="公司名称" align="center" :show-overflow-tooltip="true">
            </el-table-column>
            <el-table-column prop="money" label="金额(元)" align="center" :show-overflow-tooltip="true">
            </el-table-column>
            <el-table-column prop="add_time" label="操作时间" align="center" :show-overflow-tooltip="true">
            </el-table-column>
        </el-table>

        <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
            :current-page.sync="formInline.page" :page-sizes="[10, 20, 30, 50]" :page-size="formInline.pageSize"
            layout="total, sizes, prev, pager, next, jumper" :total="total">
        </el-pagination>
    </div>
</template>

<script>
import { rechargeList } from '@/api/childCompany/moneyManagment.js'
export default {
    //import引入的组件需要注入到对象中才能使用
    components: {},
    props: ['row'],
    data() {
        //这里存放数据
        return {
            formInline: {
                owner_id: '',
                page: 1,
                pageSize: 10
            },
            list: [],
            total: 0,
        };
    },
    //监听属性 类似于data概念
    computed: {},
    //监控data中的数据变化
    watch: {},
    //方法集合
    methods: {
        async rechargeList() {
            let res = await rechargeList(this.formInline)
            if (res.code == 200) {
                this.list = res.data ? res.data.list : [];
                this.total = res.data ? res.data.total : 0;
            }
        },
        handleSizeChange(pageSize) {
            this.formInline.pageSize = pageSize;
            this.rechargeList();
        },
        handleCurrentChange(page) {
            this.formInline.page = page;
            this.rechargeList();
        }
    },
    //生命周期 - 创建完成（可以访问当前this实例）
    created() {

    },
    //生命周期 - 挂载完成（可以访问DOM元素）
    mounted() {
        this.formInline.owner_id = this.row.happrove_id;
        this.rechargeList();
    },
    beforeCreate() { }, //生命周期 - 创建之前
    beforeMount() { }, //生命周期 - 挂载之前
    beforeUpdate() { }, //生命周期 - 更新之前
    updated() { }, //生命周期 - 更新之后
    beforeDestroy() { }, //生命周期 - 销毁之前
    destroyed() { }, //生命周期 - 销毁完成
    activated() { }, //如果页面有keep-alive缓存功能，这个函数会触发
}
</script>
<style lang='scss' scoped>
//@import url(); 引入公共css类
.dialog-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;

    &>.el-form-item {
        width: 30%;

        ::v-deep &>.el-form-item__content {
            width: 60%;
        }
    }
}
</style>